package com.game.backend.common;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.Objects;

/**
 * 功能描述
 *
 * @author wanghongqian
 * @date 2023/08/07 16:57
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class ResponseEntity implements Serializable {

    /**
     * http状态码
     */
    protected Integer status;
    /**
     * 给予用户提示的信息
     */
    protected String message;

    /**
     * 返回值
     */
    protected Object value;

    public static ResponseEntity ok(Object value){
        return new ResponseEntity(200,null,value);
    }

    public static ResponseEntity ok(){
        return new ResponseEntity(200,null,null);
    }

    public static ResponseEntity fail(String message){
        return new ResponseEntity(500,message,null);
    }

}
